package xiaohu.day0.HJ3;

import java.util.Scanner;
import java.util.TreeSet;

public class Main {
    //法一：利用Collection中的TreeSet
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            int N = in.nextInt();
            TreeSet<Integer> art = new TreeSet<>();
            while (N > 0) {
                int n = in.nextInt();
                if (!art.contains(n)) {
                    art.add(n);
                }
                --N;
            }
            art.stream().forEach(System.out::println);
        }
    }
}
